package com.tj.bo.payment.server.services.enums;

import java.util.Objects;

/**
 * 代付订单状态
 *
 * @author ZhangChao
 * @since 2021/7/19
 */
public enum DfPaymentRefCodeEnum {
    SUCCESS(1),
    FAILED(2),
    PROCESSING(3),
    UN_PROCESS(4),
    REVIEW_REJECTED(5),
    UN_REVIEW(6),
    ORDER_NOT_EXIST(7),
    UNKNOWN(8);
    private final Integer code;

    DfPaymentRefCodeEnum(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public static DfPaymentRefCodeEnum getEnum(Integer code){
        for(DfPaymentRefCodeEnum dfPaymentOrderStatusEnum : DfPaymentRefCodeEnum.values()){
            if (Objects.equals(code, dfPaymentOrderStatusEnum.getCode())){
                return dfPaymentOrderStatusEnum;
            }
        }
        return null;
    }
}
